
#ifndef __DEVICE_FILESYSTEM_OPTION_H__
#define __DEVICE_FILESYSTEM_OPTION_H__
#include "../SafeWall.h"


#ifdef __cplusplus
extern "C" {
#endif
	NTSTATUS DeviceQueryInformationFile(
		_In_ HANDLE FileHandle,
		_In_ PFILE_OBJECT FileObject,
		_Out_ PIO_STATUS_BLOCK IoStatusBlock,
		_Out_writes_bytes_(Length) PVOID FileInformation,
		_In_ ULONG Length,
		_In_ FILE_INFORMATION_CLASS FileInformationClass,
		_In_ PDEVICE_OBJECT pDeviceObject);


	NTSTATUS DeviceSetInformationFile(
		_In_ HANDLE FileHandle,
		_In_ PFILE_OBJECT FileObject,
		_Out_ PIO_STATUS_BLOCK IoStatusBlock,
		_In_reads_bytes_(Length) PVOID FileInformation,
		_In_ ULONG Length,
		_In_ FILE_INFORMATION_CLASS FileInformationClass,
		_In_ PDEVICE_OBJECT pDeviceObject);

	NTSTATUS MyFileSetInformation(
		DEVICE_OBJECT* dev, FILE_OBJECT* file,
		FILE_INFORMATION_CLASS FileInformationClass, FILE_OBJECT* setFile,
		PVOID buffer, ULONG lenght);

	NTSTATUS DeviceCreateFile(
		_Out_ PHANDLE FileHandle,
		_Out_ PFILE_OBJECT* FileObject,
		_In_ ACCESS_MASK DesiredAccess,
		_In_ OBJECT_ATTRIBUTES* ObjectAttributes,
		_Out_ PIO_STATUS_BLOCK IoStatusBlock,
		_In_opt_ PLARGE_INTEGER AllocationSize,
		_In_ ULONG FileAttributes,
		_In_ ULONG ShareAccess,
		_In_ ULONG CreateDisposition,
		_In_ ULONG CreateOptions,
		_In_ PDEVICE_OBJECT pDeviceObject);

	NTSTATUS DeviceReadFile(
		_In_ HANDLE FileHandle,
		_In_ PFILE_OBJECT FileObject,
		_Out_ PIO_STATUS_BLOCK IoStatusBlock,
		_In_reads_bytes_(Length) PVOID Buffer,
		_In_ ULONG Length,
		_In_opt_ PLARGE_INTEGER ByteOffset,
		_In_ PDEVICE_OBJECT pDeviceObject
	);

	NTSTATUS DeviceWriteFile(
		_In_ HANDLE FileHandle,
		_In_ PFILE_OBJECT FileObject,
		_Out_ PIO_STATUS_BLOCK IoStatusBlock,
		_In_reads_bytes_(Length) PVOID Buffer,
		_In_ ULONG Length,
		_In_opt_ PLARGE_INTEGER ByteOffset,
		_In_ PDEVICE_OBJECT pDeviceObject
	);

	NTSTATUS DeviceCloseFile(
		IN HANDLE FileHandle, 
		IN PDEVICE_OBJECT pDeviceObject
	);

	VOID CallNextCloseFile(
		_In_ HANDLE FileHandle,
		_In_ PFILE_OBJECT FileObject
	);

#ifdef __cplusplus
}
#endif

#endif